package com.coocaa.ops.admin.v1.homepage.biz.impl;


import com.coocaa.ops.admin.v1.homepage.biz.IHomepageModuleRlsBiz;
import com.coocaa.ops.admin.v1.homepage.mapper.IHomepageModuleRlsMapper;
import com.coocaa.ops.common.core.base.BaseBizImpl;
import com.coocaa.ops.common.core.base.mybatis.QueryTemplate;
import com.coocaa.ops.common.core.biz.homepage.entity.HomepageModuleRlsEntity;
import org.springframework.stereotype.Service;

/**
 * @author bjh
 * @description 首页和模块关联表-biz层接口实现
 * @date 2020-06-14 15:09:40
 */
@Service
public class HomepageModuleRlsBizImpl extends BaseBizImpl<IHomepageModuleRlsMapper, HomepageModuleRlsEntity> implements IHomepageModuleRlsBiz {


    @Override
    public void logicDelRls(Integer id, Integer version, Integer userId) {
        QueryTemplate<HomepageModuleRlsEntity> wrapper = new QueryTemplate<>();
        wrapper.lambda().eq(HomepageModuleRlsEntity::getHomepageId, id)
                .eq(HomepageModuleRlsEntity::getHomepageVersion, version);
                HomepageModuleRlsEntity update = new HomepageModuleRlsEntity();
        update.setFlag(0);
        update.setModifier(userId);
        getMapper().update(update, wrapper);
    }
}
